<template>
  <div class="common-head">
    <van-nav-bar
      :title="title"
      fixed
      left-arrow
      @click-left="$router.go(-1)"
      @click-right="clickRight"
    >
       <template #right>
        <slot/>
      </template>
    </van-nav-bar>
  </div>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      required: true
    }
  },
  methods: {
    clickRight () {
      this.$emit('delete')
    }
  }
}
</script>

<style lang="scss" scoped>
.common-head{
 /deep/ .van-nav-bar{
    background-color: #ff734c;
    .van-icon{
      font-size: 20px;
      color: #fff;
    }
    .van-nav-bar__title{
      color: #fff;
    }
  }
}
</style>
